﻿/**
 *
 * @file VAOneXMLAdaptorPhysicalProperty.h
 * @brief VAOne读写适配器物理属性
 * @author liuzhiyuan(liuzhiyuan@diso.cn)
 * @date 2024-10-18
 *
 */
#ifndef VAONEXMLADAPTORPHYSICALPROPERTY_H
#define VAONEXMLADAPTORPHYSICALPROPERTY_H

#include "FITKVAOneXMLIOAPI.h"
#include "FITKAbstractVAOneXMLAdaptor.h"
#include "FITK_Kernel/FITKCore/FITKCoreMacros.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"
#include "Tools/Win64/rapidxml/rapidxml.hpp"

namespace Acoustics
{
    class FITKAcousticsPhysicsPropManager;

}

namespace IO
{
    /**
     * @brief   VAOne读写适配器物理属性
     * @author  liuzhiyuan(liuzhiyuan@diso.cn)
     * @date    2024-10-16
     */
    class FITKVAOneXMLIOAPI VAOneXMLAdaptorPhysicalProperty :public FITKAbstractVAOneXMLAdaptor
    {
        FITKCLASS(IO, VAOneXMLAdaptorPhysicalProperty);
    public:
         explicit VAOneXMLAdaptorPhysicalProperty()= default;
         ~VAOneXMLAdaptorPhysicalProperty() = default;
        /**
         * @brief   适配器读数据
         * @return  是否执行成功
         * @author  liuzhiyuan(liuzhiyuan@diso.cn)
         * @date    2024-10-22
         */
        bool adaptR() override;
        /**
         * @brief   适配器写数据
         * @return  是否执行成功
         * @author  liuzhiyuan(liuzhiyuan@diso.cn)
         * @date    2024-10-22
         */
        bool adaptW() override;

    private:
        /**
         * @brief 读取梁xml
         * @return bool 读取是否成功
         * @author liuzhiyuan(liuzhiyuan@diso.cn)
         * @date 2024-10-17
         */
        bool readBeam();
        /**
         * @brief 写入梁xml
         * @return bool 读取是否成功
         * @author liuzhiyuan(liuzhiyuan@diso.cn)
         * @date 2024-10-17
         */
        bool writeBeam();

        /**
         * @brief 读取均质板xml
         * @return bool 读取是否成功
         * @author liuzhiyuan(liuzhiyuan@diso.cn)
         * @date 2024-10-17
         */
        bool readUniform(rapidxml::xml_node<char> *node);

        /**
         * @brief 写入均质板xml
         * @return bool 读取是否成功
         * @author liuzhiyuan(liuzhiyuan@diso.cn)
         * @date 2024-10-17
         */
        bool writeUniform();
        /**
         * @brief 读取三明治板xml(预留)
         * @return bool 读取是否成功
         * @author liuzhiyuan(liuzhiyuan@diso.cn)
         * @date 2024-10-17
         */
        bool readSandwichPhysicalProperty();
        /**
         * @brief 读取自由阻尼层合板xml
         * @return bool 读取是否成功
         * @author liuzhiyuan(liuzhiyuan@diso.cn)
         * @date 2024-10-17
         */
        bool readGeneralLaminatePhysicalProperty(rapidxml::xml_node<char> *node);
        /**
         * @brief 写入自由阻尼层合板xml
         * @return bool 读取是否成功
         * @author liuzhiyuan(liuzhiyuan@diso.cn)
         * @date 2024-10-17
         */
        bool writeGeneralLaminatePhysicalProperty();
        /**
         * @brief 读取加筋板xml
         * @return bool 读取是否成功
         * @author liuzhiyuan(liuzhiyuan@diso.cn)
         * @date 2024-10-17
         */
        bool readRibbedPhysicalProperty(rapidxml::xml_node<char>* node);
        /**
         * @brief 写加筋板xml
         * @return bool 读取是否成功
         * @author liuzhiyuan(liuzhiyuan@diso.cn)
         * @date 2024-10-17
         */
        bool writeRibbedPhysicalProperty();
        /**
         * @brief 读取复合材料板xml（预留）
         * @return bool 读取是否成功
         * @author liuzhiyuan(liuzhiyuan@diso.cn)
         * @date 2024-10-17
         */
        bool readDuctPhysicalProperties();
        /**
         * @brief 读取复合材料板xml（预留）
         * @return bool 读取是否成功
         * @author liuzhiyuan(liuzhiyuan@diso.cn)
         * @date 2024-10-17
         */
        bool readCompositePhysicalProperty();
        /**
         * @brief 读取板壳xml
         * @return bool 读取是否成功
         * @author liuzhiyuan(liuzhiyuan@diso.cn)
         * @date 2024-10-17
         */
        bool readShellPhysicalProperties();
        /**
         * @brief 写板壳xml
         * @return bool 读取是否成功
         * @author liuzhiyuan(liuzhiyuan@diso.cn)
         * @date 2024-10-17
         */
        bool writeShellPhysicalProperties();


        rapidxml::xml_node<char>* _shellPhysicalPropertiesNode{};

        Acoustics::FITKAcousticsPhysicsPropManager* _physicsPropDataManager{};

    };
    Register2FITKIOAdaptorFactory(VAOneXML, Acoustics::FITKAcousticsPhysicsPropManager, VAOneXMLAdaptorPhysicalProperty)
}

#endif // VAONEXMLADAPTORPHYSICALPROPERTY_H
